package com.stylefeng.guns.config.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.resource.ContentVersionStrategy;
import org.springframework.web.servlet.resource.ResourceUrlProvider;
import org.springframework.web.servlet.resource.VersionResourceResolver;

/**
 * <pre>
 *    author  : xiej
 *    time    : 2018/5/3019:11
 *    desc    : 输入描述
 *    version : v1.0
 * </pre>
 */
@Configuration
public class ControllerConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        VersionResourceResolver versionResourceResolver = new VersionResourceResolver()
//                .addVersionStrategy(new ContentVersionStrategy(), "/**");
//        registry.addResourceHandler("/modular/*.js")
//                .addResourceLocations("classpath:/static/")
//                .setCachePeriod(60 * 60 * 24 * 365) /* one year */
//                .resourceChain(true)
//                .addResolver(versionResourceResolver);
    }
}